import JSEncrypt from 'jsencrypt'

// 公钥
const publicKey = `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtWAnOw4a5AVHRDo8oqVcuH+UxEkpU8uOLZHbxwaofM+yQU42rkBuI/+N+WpWmM7gPJEZXTyQApqxlZXSoEOYHKrZkGVY03Le3Ofvi2GZWtZhuRlBOeoh+xN9Qs1BiZ3lLvyK/+TNZ1YmiCUHOdmb6ASqi5WvDdCEsxoY2fEcgJazqYMaJ0FFNIiCUdenN815hcrJ3KmIQ6TUEHF1cPDA24sVMKD/0pSOJrilSQIFTBn1XHvj2kpY8Q+9VBautIJo0ti+DMzv7S73IJCkfzQGBGkidu8cWKdRCkEzMZfikFYNuDJx+TKPZGi18HEYZIU0hi/GO4iDPT/vPSm+eaQtmwIDAQAB` // 这里需要替换成实际的公钥

// RSA加密
export function rsaEncrypt(text: string) {
    const encryptor = new JSEncrypt()
    encryptor.setPublicKey(publicKey)
    return encryptor.encrypt(text)
}
